import request from '@/utils/request'
// 任务：获取任务信息（分页）
export const GetTaskService = (data) => request.post('/task/query', data)

// 任务：获取节点任务列表
export const GetTaskListService = (nodeId) =>
  request.get('/task/queryList?nodeId=' + nodeId)

// 任务：获取任务详情
export const GetDetailTaskService = (id) => request.get('/task/info?id=' + id)

// 任务 ：获取任务结果信息
export const GetResultTaskService = (id) =>
  request.get('/result/query?taskId=' + id)

// 任务：添加任务信息
export const AddTaskService = ({ lists, priority, nodeId, algType }) =>
  request.get(
    `/task/create/list?list=${lists}&priority=${priority}&nodeId=${nodeId}&algType=${algType}`
  )

// 任务：交换位置
export const ChangeTaskService = (id) => request.get(`/task/exchange?id=${id}`)

// 任务：新增任务
export const AddstatusTaskService = ({ list, priority, nodeId }) =>
  request.post('/create/list', { list, priority, nodeId })

// 任务：编辑任务
export const EditTaskService = (data) => request.post('/task/update', data)

// 任务数据源：编辑任务
export const GetSourceTaskService = (type) =>
  request.get(`/sources/queryInfo?type=${type}`)

// 任务：删除任务
export const DelTaskService = (id) => request.get('/task/remove?id=' + id)
